package com.hd.service.impl;

import com.hd.dao.AdvertDao;
import com.hd.entity.Advert;
import com.hd.service.AdvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AdvertServiceImpl implements AdvertService {
    @Autowired
    private AdvertDao advertDao;


    @Override
    public Advert addAdvert(Advert advert) {
        return advertDao.save(advert);
    }

    @Override
    public List<Advert> selectAdverts() {
        return advertDao.findAll();
    }
}
